/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package PackageUpdater.UI;

import PackageUpdater.Config.UpdateList;
import java.util.Comparator;

/**
 *
 * @author wcss
 */
public class ComparatorUpdateIndex implements Comparator {

    @Override
    public int compare(Object o1, Object o2) {
        UpdateList ul0 = (UpdateList) o1;
        UpdateList ul1 = (UpdateList) o2;
        int diff = ul0.getUpdateIndex() - ul1.getUpdateIndex();
        if (diff > 0) {
            return 1;
        } else if (diff < 0) {
            return -1;
        } else {
            return 0;
        }
    }
}
